package com.droowa.model.dao;

import java.sql.SQLException;
import java.util.Date;
import java.util.HashMap;
import java.util.List;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;



import com.droowa.domain.ReturnManagement;


@Repository
public class ReturnManagementDAOMybatisImpl implements ReturnManagementDAO {
	@Autowired
	private SqlSessionTemplate session;

	public int insertReturnManagement(ReturnManagement returnManagement)throws SQLException {
		return session.insert(makeSqlId("insertReturnManagement"),returnManagement);
	}

	public int updateReturnManagement(ReturnManagement returnManagement)throws SQLException {
		return session.update(makeSqlId("updateReturnManagement"), returnManagement);
	}

	public int deleteReturnManagement(String orderNumber) throws SQLException {
		return session.delete(makeSqlId("deleteReturnManagement"), orderNumber);
	}

	
	@Override
	public List<ReturnManagement> selectReturnManagementByAll(HashMap map)throws SQLException {
		return session.selectList(makeSqlId("selectReturnManagementByAll"),map);
	}

	private String makeSqlId(String id){
		return "droowa.returnManagement."+id;
	}
}
